<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
if($session_kind == 'crm'){
	if(!in_array('crm_user_select',$QXARR))exit(noauth());
}else{
	if(!in_array('u_select',$QXARR))exit(noauth());
}
if ( !ifint($uid))alert_adm("用户UID不正确","back");
$qxflagARR = json_decode($_CRM['qxflag'],true);
switch ($submitok) {
	case"utext":
		if (!ifint($uid))json_exit(array('flag'=>0,'msg'=>'亲，用户不存在'));
		$C = get_udata_text($uid);
		if(!empty($C)){
			json_exit(array('flag'=>1,'C'=>$C));
		}else{
			json_exit(array('flag'=>0,'msg'=>'用户不存在'));
		}
	break;
}
//会员库
//$hyk = (ifint($hyk,'1-4','1'))?$hyk:3;
$hyk=intval($hyk);
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'cache/config_vip.php';
require_once ZEAI.'m/div_left_so.php';
$sex_ARR  = json_decode($_UDATA['sex'],true);$extifshow = json_decode($_UDATA['extifshow'],true);
$mate_diy = explode(',',$_ZEAI['mate_diy']);
$qianxian_num = json_decode($_VIP['qianxian_num'],true);
/****************************************UID信息*****************************************/
$row = $db->ROW(__TBL_USER__,"*","id=".$uid);
if(!$row)alert_adm("UID输入有误或不存在此会员","back");
$Utruename = dataIO($row['truename'],'out');
$Unickname = trimhtml(dataIO($row['nickname'],'out'));
$Usex   = $row['sex'];
$Ugrade = $row['grade'];
$Uphoto_s= $row['photo_s'];
$Ukind   = $row['kind'];
$Ubirthday = $row['birthday'];
$Uheigh    = $row['heigh'];
$Uweigh    = $row['weigh'];
$Upay      = $row['pay'];
$Uedu      = $row['edu'];
$Ujob      = $row['job'];
$Uareaid   = $row['areaid'];
$Ulove     = $row['love'];
$Uhouse    = $row['house'];
$Ucar      = $row['car'];
$Uareaid   = $row['areaid'];
$Uareaid2  = $row['area2id'];
$Uchild    = $row['child'];
$Umarrytime= $row['marrytime'];
$Ucompanykind= $row['companykind'];
$Usmoking    = $row['smoking'];
$Udrink      = $row['drink'];
$Uif2      = $row['if2'];
$Usjtime   = $row['sjtime'];
$Uage_str   = (@getage($Ubirthday)<=0)?'':@getage($Ubirthday).'岁';
$Umarrytype_str = udata('marrytype',intval($row['marrytype']));
$Umarrytime_str = udata('marrytime',intval($row['marrytime']));
$Ucompanykind_str = udata('companykind',intval($row['companykind']));
$Usmoking_str = udata('smoking',intval($row['smoking']));
$Udrink_str   = udata('drink',intval($row['drink']));
$Uedu_str   = udata('edu',$Uedu);
$Upay_str   = udata('pay',$Upay);
$Ujob_str   = udata('job',$Ujob);
$Ulove_str  = udata('love',$Ulove);
$Uchild_str = udata('child',$Uchild);
$Uhouse_str = udata('house',$Uhouse);
$Ucar_str   = udata('car',intval($Ucar));
//$Uheigh_str = (intval($Uheigh)>0)?intval($Uheigh).'kg':'';
//$Uweigh_str = (intval($Uweigh)>0)?intval($Uweigh).'cm':'';
$Uheigh_str = udata('heigh',$Uheigh);
$Uweigh_str = udata('weigh',$Uweigh);
$Uareatitle = $row['areatitle'];
$Uarea2title= $row['area2title'];
$Ucrm_qxnum = $row['crm_qxnum'];
$Ucrm_yjnum = $row['crm_yjnum'];
	$mate_age1      = intval($row['mate_age1']);
	$mate_age2      = intval($row['mate_age2']);
	$mate_heigh1    = intval($row['mate_heigh1']);
	$mate_heigh2    = intval($row['mate_heigh2']);
	$mate_pay       = $row['mate_pay'];
	$mate_edu       = $row['mate_edu'];
	$mate_areaid    = $row['mate_areaid'];
	$mate_areatitle = $row['mate_areatitle'];
	$mate_love      = $row['mate_love'];
	$mate_car       = $row['mate_car'];
	$mate_house     = $row['mate_house'];
	$mate_weigh1      = intval($row['mate_weigh1']);
	$mate_weigh2      = intval($row['mate_weigh2']);
	$mate_job         = $row['mate_job'];
	$mate_child       = $row['mate_child'];
	$mate_marrytime   = $row['mate_marrytime'];
	$mate_companykind = $row['mate_companykind'];
	$mate_smoking     = $row['mate_smoking'];
	$mate_drink       = $row['mate_drink'];
	$mate_areaid2     = $row['mate_areaid2'];
	$mate_areatitle2  = $row['mate_areatitle2'];
$Umate_li_out= mate_echo($row);
//
$Uphoto_m_url = (!empty($Uphoto_s))?UP.smb($Uphoto_s,'m'):RES.'photo_m'.$Usex.'.png';
$Unickname = (empty($Unickname))?$Utruename:$Unickname;
$Uqxneednum=$Ucrm_qxnum;
$Uqxnum2 = $db->COUNT(__TBL_QIANXIAN__,"flag=2 AND (uid=".$uid." OR senduid=".$uid.")");
/****************************************UID信息 结束*************************************/
/****************************************SQL 开始*****************************************/
$SQL  = " (flag=1 OR flag=-2) AND kind<>4 AND crm_flag<>3";
$SQL .= " AND id<>".$uid;
$SQL .= ($Usex == 2)?" AND sex=1 ":" AND sex=2 ";
//超管搜索按门店
if (ifint($agentid) && CRM_ADM)$SQL .= " AND agentid=$agentid";
//会员库
switch ($hyk) {
	case 1:$SQL .= " AND (admid=".$session_uid." OR hnid=".$session_uid." OR hnid2=".$session_uid.")";break;//我的会员库
	case 2:$SQL .= getAgentSQL();break;//非超管匹配自己门店
	case 3:$SQL .= '';break;
	default:$SQL .= mate_diy_SQL();break;//按择偶要求
}
switch ($s) {
	case 'ext':
		$Skey  = trimhtml($Skey);
		$Skey2 = trimhtml($Skey2);
		if (!empty($Skey) || !empty($Skey2)){//按会员UID/昵称/姓名/手机
			if(ifmob($Skey)){
				$SQL .= " AND (mob='".$Skey."' OR mob2='".$Skey."') ";
			}elseif(ifint($Skey)){
				$SQL .= " AND id=".$Skey;
			}else{
				$SQL .= " AND (( truename LIKE '%".$Skey."%' ) OR ( crm_ubz LIKE '%".$Skey."%' ) OR ( uname LIKE '%".$Skey."%' ) OR ( nickname LIKE '%".$Skey."%' ) OR ( nickname LIKE '%".urlencode($Skey)."%' )) ";
			}
			if(ifint($Skey2))$SQL .= " AND admid=".$Skey2;
		}else{
			//CRM按客户分类
			if(ifint($crm_ukind))$SQL .= " AND crm_ukind=$crm_ukind";
			//CRM按客户等级
			if(ifint($crm_ugrade))$SQL .= " AND crm_ugrade=$crm_ugrade";
			//符合双方
			if($fhsf == 1)$SQL .= mate_diy_SQL2();
			//
			$sex=trimhtml(dataIO($sex,'out'));if(!empty($sex))$SQL .= doinsql('sex',$sex);
			$photo_s=intval($photo_s);if ($photo_s == 1)$SQL .= " AND photo_s<>''";
			$areaid=trimhtml(dataIO($areaid,'out'));
			$area2id=trimhtml(dataIO($area2id,'out'));
			$areaid=getareaSQL($areaid);
			$area2id=getareaSQL($area2id);
			if(!empty($areaid))$SQL .= " AND areaid LIKE '%".$areaid."%' ";
			if(!empty($area2id))$SQL .= " AND area2id LIKE '%".$area2id."%' ";
			//age
			$age=trimhtml(dataIO($age,'out'));
			if(!empty($age)){
				$V=explode(',',$age);
				$V1=intval($V[0]);$V2=intval($V[1]);
				if(ifint($V1))$SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) >= '$V1' ) ";
				if(ifint($V2))$SQL .= " AND ( (YEAR(CURDATE())-YEAR(birthday)-(RIGHT(CURDATE(),5)<RIGHT(birthday,5))) <= '$V2' ) ";
			}
			//heigh
			$heigh=trimhtml(dataIO($heigh,'out'));
			if(!empty($heigh)){
				$V=explode(',',$heigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$SQL .= " AND ( heigh >= '$V1' ) ";
				if (ifint($V2))$SQL .= " AND ( heigh <= '$V2' ) ";
			}
			//weigh
			$weigh=trimhtml(dataIO($weigh,'out'));
			if(!empty($weigh)){
				$V=explode(',',$weigh);$V1=intval($V[0]);$V2=intval($V[1]);
				if (ifint($V1))$SQL .= " AND ( weigh >= '$V1' ) ";
				if (ifint($V2))$SQL .= " AND ( weigh <= '$V2' ) ";
			}
			//edu
			$edu=intval($edu);if(!empty($edu))$SQL .= " AND ( edu >= '$edu' ) ";
			//pay
			$pay=intval($pay);if(!empty($pay))$SQL .= " AND ( pay >= '$pay' ) ";
			//job
			$job=trimhtml(dataIO($job,'out'));if(!empty($job))$SQL .= doinsql('job',$job);
			//love
			$love=trimhtml(dataIO($love,'out'));if(!empty($love))$SQL .= doinsql('love',$love);
			//child
			$child=trimhtml(dataIO($child,'out'));if(!empty($child))$SQL .= doinsql('child',$child);
			//house
			$house=trimhtml(dataIO($house,'out'));if(!empty($house))$SQL .= doinsql('house',$house);
			//nation
			$nation=trimhtml(dataIO($nation,'out'));if(!empty($nation))$SQL .= doinsql('nation',$nation);
			//car
			$car=trimhtml(dataIO($car,'out'));if(!empty($car))$SQL .= doinsql('car',$car);
			//marrytime
			$marrytime=trimhtml(dataIO($marrytime,'out'));if(ifint($marrytime))$SQL .= " AND marrytime='$marrytime' ";
		}
	break;
//	default://按择偶要求
//		$SQL .= mate_diy_SQL();
//	break;
}
$sortSQL = " ORDER BY refresh_time DESC,id DESC ";
/*************************************  SQL结束 ********************************************/
$t=trimhtml($t);
$nav='index';
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<!--ext-->
<script src="<?php echo HOST;?>/cache/udata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo HOST;?>/cache/areadata.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/zeai_div_area.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="js/m_qianxian_select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>zeai_ios_select/separate/select.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<!--ext end-->
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ZEAI_list{padding:125px 0 80px;width:92%;margin:0 auto}
.ZEAI_list dl{width:100%;margin:0 auto 20px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 28px rgb(0 0 0 / 8%);position:relative;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;position:relative}
.ZEAI_list dl .tbody{padding:0 10px;margin:0 auto 10px auto;line-height:40px;color:#999;border-bottom:#f5f5f5 1px solid;text-align:left}
.ZEAI_list dl .tbody{text-align:left;color:#999}
.ZEAI_list dl .tbody b,.ZEAI_list dl .tbody font{display:inline-block;color:#000;font-weight:normal;vertical-align:middle}
.ZEAI_list dl .tbody font{color:#999}
.ZEAI_list dl .tbody .vip_title{float:right;line-height:44px;position:relative}
.ZEAI_list dl .tbody .vip_title a{border:0}
.tip_top{min-width:60px;line-height:24px;font-size:12px;text-align:center;border-radius:12px;position:relative}
.tip_top:after{content:'';position:absolute;left:-webkit-calc(50% - 5px);bottom:17px;transform:rotate(45deg);width:0;height:0;border-top:10px solid transparent;border-right:10px solid transparent;border-top:10px solid #eee;}
.tip_top{position:absolute;right:-webkit-calc(50% - 30px);top:40px}

.ZEAI_list dl dt,.ZEAI_list dl dd{float:left;display:block}
.ZEAI_list dl dt{width:50px;padding-left:10px;font-size:13px;text-align:left;line-height:150%;}
.ZEAI_list dl dt img.photo_s{width:40px;height:40px;object-fit:cover;-webkit-object-fit:cover;border-radius:50%}
.ZEAI_list dl dt .myinfobfb{left:10px;top:85px}
.ZEAI_list dl dt .user_kind{left:10px;top:105px;position:absolute;color:#999;width:40px;text-align:center}
.ZEAI_list dl dt .user_kind font.kind1{color:<?php echo $_ADM['color'];?>}
.ZEAI_list dl dt .user_kind font.kind2{color:#999}
.ZEAI_list dl dt .user_kind font.kind3{color:#009688}
.ZEAI_list dl dd{width:-webkit-calc(100% - 120px);text-align:left;line-height:180%;min-height:80px}
.ZEAI_list dl dd span{height:13px;line-height:13px;display:inline-block;border-right:#eee 1px solid;margin-right:6px;padding-right:6px;color:#666}
.ZEAI_list dl dd span:last-child{border:0;margin:0;padding:0}
.ZEAI_list dl .flag_ico,.ZEAI_list dl .crm_flag3_ico{position:absolute}
.ZEAI_list dl .flag_ico{right:24px;top:88px;width:44px;height:44px}
.ZEAI_list dl .crm_flag3_ico{right:19px;top:65px;width:50px;height:50px}

.ZEAI_list dl .datali{margin-top:5px;padding:0 10px;text-align:left;position:relative}
/*u2data*/
.u2data{text-align:left;padding:0 15px}
.u2data .dt{line-height:24px;height:24px;color:<?php echo $_ADM['color'];?>}
.u2data .dt i{width:26px;height:26px;line-height:24px;border-radius:16px;text-align:center;margin-right:8px;font-size:16px;box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}
.u2data .dt span{color:#999;font-weight:normal;float:right;margin-top:3px;margin-right:3px}
.u2data .dd{line-height:200%;margin-left:12px;padding:5px 0 5px 14px}
.u2data .dd.onoff{line-height:200%;padding-left:20px}
.u2data .dd.onoff font{color:#999}
.u2data .dt i{border:rgba(<?php echo c16_rgb($_ADM['color']);?>,.15) 1px solid;color:rgba(<?php echo c16_rgb($_ADM['color']);?>,.3);}
.u2data .dd{border-left:rgba(<?php echo c16_rgb($_ADM['color']);?>,.1) 1px solid;}
.u2data .dd span{display:inline-block;padding:0 5px;margin:4px 8px 4px 0;border-radius:3px;box-shadow:0 0 4px rgb(0 0 0 / 9%);max-width:94%;word-wrap:break-word}
.u2data .dd b{color:#ccc;font-weight:normal;margin:0 10px}
.u2data .dd span font{color:#999}
.u2data .dd span img{width:40px;height:40px;display:block;margin:0 auto;border-radius:4px}
.u2data .onoff{display:none}
.ZEAI_list dl .ubtnbox{line-height:50px;height:50px;text-align:right;margin-top:15px}
.ZEAI_list dl .ubtnbox .btn{margin:5px 10px 0 0;padding:0 8px}
.ZEAI_list dl .ubtnbox a:first-child{margin-left:10px}

.listbottombox .qxnum{display:inline-block;margin-top:5px}
.listbottombox .qxnum b{color:#f00;font-weight:normal;margin:0 2px}

.tabmenufix {top:72px;}
img.photo_s_iframe{display:block;width:55px;height:55px;margin:5px auto 0 auto;border-radius:30px;vertical-align:middle;object-fit:cover;-webkit-object-fit:cover}

.utopinfo {width:100vw;height:22px;line-height:14px;background-color:#fff;position:fixed;top:50px;left:0;color:#000;font-size:12px;z-index:3}
.utopinfo em{display:inline-block;vertical-align:middle}
.utopinfo span{color:#999;vertical-align:middle}
</style>
</head><body>
<?php
$mini_title ='<img src="'.$Uphoto_m_url.'" class="photo_s_iframe">';
$mini_class='top_mini4 ';
$miniurl='m_crm_user.php?t='.$t.'&p='.intval($b);
$mini_L = '<em onClick="zeai.openurl(\''.$miniurl.'\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<div class="utopinfo"><?php echo uicon($Usex.$Ugrade);?><em><?php echo $uid;?></em><span><?php echo '（'.$Unickname.'）';?></span></div>
<div class="tabmenu tabmenu3 tabmenufix">
	<a href="m_qianxian.php?uid=<?php echo $uid;?>&t=<?php echo $t;?>&b=<?php echo $b;?>&hyk=<?php echo $hyk;?>">牵线列表</a>
	<a href="m_qianxian_select.php?s=<?php echo $s;?>&uid=<?php echo $uid;?>&t=<?php echo $t;?>&b=<?php echo $b;?>&hyk=<?php echo $hyk;?>" class="ed">选择牵线对象</a>
	<a onClick="user_searchFn();">按条件筛选</a>
</div>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="客户UID/昵称/姓名/手机/备注" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey2" type="text" class="input" id="Skey2" maxlength="20" value="<?php echo $Skey2;?>" placeholder="认领红娘ID" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		$FT=json_decode(FT,true);
		if(CRM_ADM){
			$rt2=$db->query("SELECT id,title FROM ".__TBL_CRM_AGENT__." WHERE flag=1 ORDER BY px DESC,id DESC");
			$total2 = $db->num_rows($rt2);
			if ($total2 > 0) {
				for($j=0;$j<$total2;$j++) {
					$rows2 = $db->fetch_array($rt2,'name');
					if(!$rows2)break;
					$agentARR[] = array('i'=>$rows2['id'],'v'=>$rows2['title']);
				}
				div_left_so_out(array('tbody'=>'所属门店','t'=>'agentid','tv'=>$agentid,'subkind'=>2,'newarr'=>json_decode(encode_json($agentARR)),'show'=>'off','ulcls'=>' col3'));
			}
		}
        div_left_so_out(array('tbody'=>'配对范围','t'=>'hyk','tv'=>$hyk,'subkind'=>2,'bx'=>1,'newarr'=>json_decode('[{"i":"0","v":"择偶要求"},{"i":"3","v":"总库"},{"i":"1","v":"我的客户"},{"i":"2","v":"我的门店"}]'),'ulcls'=>' col3'));//会员库
		div_left_so_out(array('tbody'=>'客户分类','t'=>'crm_ukind','tv'=>$crm_ukind,'subkind'=>2,'newarr'=>json_decode($_UDATA['crm_ukind']),'show'=>'off','ulcls'=>' col3'));
		div_left_so_out(array('tbody'=>'线下VIP等级','t'=>'crm_ugrade','tv'=>$crm_ugrade,'subkind'=>2,'newarr'=>json_decode($_UDATA['crm_ugrade']),'show'=>'off','ulcls'=>' col2'));
		//div_left_so_out(array('tbody'=>$FT['sex']['t'],'t'=>'sex','tv'=>$sex,'subkind'=>3,'newarr'=>json_decode($_UDATA['sex']),'ulcls'=>' col3'));//性别
        div_left_so_out(array('tbody'=>$FT['photo_s']['t'],'t'=>'photo_s','tv'=>$photo_s,'subkind'=>2,'newarr'=>json_decode('[{"i":"1","v":"有头像"}]'),'ulcls'=>' col3'));//头像
		//默认值
		function range_str($F,$V) {
			if(empty($V))return '';
			global $_UDATA;
			$FARR=explode(',',$V);
			$F1=$FARR[0];$F2=$FARR[1];
			$F_UDATA=json_decode($_UDATA[$V],true);
			$F_str = mateset_out($F1,$F2,$F_UDATA['dw']);
			$F_str = str_replace("不限","",$F_str);
			return $F_str;
		}
        ?>
        <div class="listbox"><dl id="age" data="<?php echo (empty($age))?'23,24':$age;?>" class="rang"><dt>年龄范围</dt><dd><span><?php echo range_str('age',$age);?></span></dd></dl></div>
        <input type="hidden" id="form_age" name="age" value="<?php echo $age;?>">
        <div class="listbox"><dl id="heigh" data="<?php echo (empty($heigh))?'160,175':$heigh;?>" class="rang"><dt>身高范围</dt><dd><span><?php echo range_str('heigh',$heigh);?></span></dd></dl></div>
        <input type="hidden" id="form_heigh" name="heigh" value="<?php echo $heigh;?>">
        <div class="listbox"><dl id="weigh" data="<?php echo (empty($weigh))?'50,70':$weigh;?>" class="rang"><dt>体重范围</dt><dd><span><?php echo range_str('weigh',$weigh);?></span></dd></dl></div>
        <input type="hidden" id="form_weigh" name="weigh" value="<?php echo $weigh;?>">
        <!--地区-->
        <!--gz-->
        <div id="areabox" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_areaid" name="areaid" value="<?php echo $areaid;?>">
        <input type="hidden" id="form_areatitle" name="areatitle" value="<?php echo $areatitle;?>">
        <div class="listbox">
            <dl id="areaid" data="<?php echo $areaid;?>"><dt>工作地</dt><dd><span id="areatitle"><?php echo $areatitle;?></span></dd></dl>
        </div>
        <!--hj-->
        <div id="areabox2" class="areabox"><div class="ul"><li><dl><dd></dd></dl></li></div></div>
        <input type="hidden" id="form_area2id" name="area2id" value="<?php echo $area2id;?>">
        <input type="hidden" id="form_area2title" name="area2title" value="<?php echo $area2title;?>">
        <div class="listbox">
            <dl id="area2id" data="<?php echo $area2id;?>"><dt>户籍地</dt><dd><span id="area2title"><?php echo $area2title;?></span></dd></dl>
        </div>
        <!--地区结束-->
        <?php
        div_left_so_out(array('tbody'=>$FT['job']['t'],'t'=>'job','tv'=>$job,'subkind'=>3,'newarr'=>json_decode($_UDATA['job']),'ulcls'=>' col3','show'=>'off'));//职业
        div_left_so_out(array('tbody'=>$FT['house']['t'],'t'=>'house','tv'=>$house,'subkind'=>3,'newarr'=>json_decode($_UDATA['house']),'ulcls'=>' col2','show'=>'off'));//房
        div_left_so_out(array('tbody'=>$FT['car']['t'],'t'=>'car','tv'=>$car,'subkind'=>3,'newarr'=>json_decode($_UDATA['car']),'ulcls'=>' col2','show'=>'off'));//车
        div_left_so_out(array('tbody'=>$FT['nation']['t'],'t'=>'nation','tv'=>$nation,'subkind'=>3,'newarr'=>json_decode($_UDATA['nation']),'ulcls'=>' col3','show'=>'off'));//民族
        div_left_so_out(array('tbody'=>$FT['love']['t'],'t'=>'love','tv'=>$love,'subkind'=>3,'newarr'=>json_decode($_UDATA['love']),'ulcls'=>' col3','show'=>'off'));//婚况
        div_left_so_out(array('tbody'=>$FT['child']['t'],'t'=>'child','tv'=>$child,'subkind'=>3,'newarr'=>json_decode($_UDATA['child']),'ulcls'=>' col3','show'=>'off'));//小孩
        div_left_so_out(array('tbody'=>'最低'.$FT['edu']['t'],'t'=>'edu','tv'=>$edu,'subkind'=>2,'newarr'=>json_decode($_UDATA['edu']),'ulcls'=>' col3','show'=>'off'));//学历
        div_left_so_out(array('tbody'=>'最低'.$FT['pay']['t'],'t'=>'pay','tv'=>$pay,'subkind'=>2,'newarr'=>json_decode($_UDATA['pay']),'ulcls'=>' col3','show'=>'off'));//收入
        div_left_so_out(array('tbody'=>$FT['marrytime']['t'],'t'=>'marrytime','tv'=>$marrytime,'subkind'=>2,'newarr'=>json_decode($_UDATA['marrytime']),'ulcls'=>' col3','show'=>'off'));//结婚时间	
        ?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so',['t','s','b','uid'])">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
        <input type="hidden" name="s" value="ext">
        <input type="hidden" name="b" id="b" value="<?php echo $b;?>" />
        <input type="hidden" name="t" id="t" value="<?php echo $t;?>" />
        <input type="hidden" name="uid" id="uid" value="<?php echo $uid;?>" />
    </form>
</div>
<!--div_left_so end-->

<form id="www_zeai_cn_FORM" class="ZEAI_list" method="get" action="<?php echo SELF; ?>">
	<?php
	$fields  = ",birthday,heigh,weigh,edu,pay,job,love,child,house,car,areatitle,area2title,smoking,drink,marrytype,marrytime,companykind,weixin,qq,mob,mob2,weixin_pic";
	$fields .= ",mate_age1,mate_age2,mate_heigh1,mate_heigh2,mate_weigh1,mate_weigh2,mate_pay,mate_edu,mate_love,mate_car,mate_house,mate_areaid,mate_areatitle,mate_job,mate_child,mate_marrytime,mate_companykind,mate_smoking,mate_drink,mate_areaid2,mate_areatitle2,mate_other";
	$rt = $db->query("SELECT id,agenttitle,kind,agentid,admid,admtime,admname,hnid,hnname,hnid2,hnname2,nickname,if2,sjtime,truename,photo_s,photo_f,sex,grade,flag,crm_ubz,myinfobfb,crm_ugrade,crm_ukind,crm_usjtime1,crm_usjtime2,regtime,endtime,flag,crm_flag,seatime,crm_usjtime1,crm_usjtime2,tguid,crm_ubz,RZ".$fields.$MATCHSQL.$BBSSQL.$QXSQL." FROM ".__TBL_USER__." U WHERE ".$SQL.$SQL_SQ_SH.$sortSQL." LIMIT ".$_ADM['admLimit']);
	$total = $db->num_rows($rt);
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=8;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt,'name');if(!$rows) break;
			$id = $rows['id'];$uidd = $id ;
			$nickname = trimhtml(dataIO($rows['nickname'],'out'));
			$truename = trimhtml(dataIO($rows['truename'],'out'));
			$nickname = str_replace($Skey,"<b class='Cf00'>".$Skey."</b>",$nickname);
			$truename = str_replace($Skey,"<b class='Cf00'>".$Skey."</b>",$truename);
			$sex      = $rows['sex'];
			$grade    = $rows['grade'];
			$photo_s  = $rows['photo_s'];
			$photo_f  = $rows['photo_f'];
			$birthday = $rows['birthday'];
			$regtime  = YmdHis($rows['regtime'],'Ymd');
			$flag = $rows['flag'];
			$myinfobfb = $rows['myinfobfb'];
			//
			$weixin     = trimhtml(dataIO($rows['weixin'],'out'));
			$qq         = trimhtml(dataIO($rows['qq'],'out'));
			$mob        = trimhtml(dataIO($rows['mob'],'out'));
			$mob2       = trimhtml(dataIO($rows['mob2'],'out'));
			$weixin_pic = $rows['weixin_pic'];
			//
			$kind  = intval($rows['kind']);
			//$tguid = $rows['tguid'];
			$RZ    = $rows['RZ'];
			$areatitle  = $rows['areatitle'];
			$area2title = $rows['area2title'];
			$photo_s_url = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
            $crm_usjtime1 = intval($rows['crm_usjtime1']);
            $crm_usjtime2 = intval($rows['crm_usjtime2']);
            $crm_ugrade = intval($rows['crm_ugrade']);
            $crm_ukind  = intval($rows['crm_ukind']);
            $crm_flag  = intval($rows['crm_flag']);
            $agentid   = intval($rows['agentid']);
            $admid     = intval($rows['admid']);
            $hnid      = intval($rows['hnid']);
            $hnid2     = intval($rows['hnid2']);
            $admtime   = intval($rows['admtime']);
            $admname   = dataIO($rows['admname'],'out');
            $hnname    = dataIO($rows['hnname'],'out');
            $hnname2   = dataIO($rows['hnname2'],'out');
            $agenttitle= dataIO($rows['agenttitle'],'out');
			$myinfobfb = $rows['myinfobfb'];
            $bbsnum   = intval($rows['bbsnum']);
            $qxnum    = intval($rows['qxnum']);
            $crm_ubz   = trimhtml(dataIO($rows['crm_ubz'],'out'));
			$truename   = (!empty($truename))?$truename.'・':'';
			$areatitle  = (empty($areatitle))?'':'<span>'.$areatitle.'</span>';
			$heigh = (intval($rows['heigh'])>0)?'<span>'.udata('heigh',intval($rows['heigh'])).'</span>':'';
			$weigh = (intval($rows['weigh'])>0)?'<span>'.udata('weigh',intval($rows['weigh'])).'</span>':'';
			$birthday  = (!empty($rows['birthday']) && $rows['birthday']!='0000-00-00')?'<span>'.$rows['birthday'].'</span>':'';
			$age   = (@getage($rows['birthday'])<=0)?'':'<span>'.@getage($rows['birthday']).'岁</span>';
			$edu   = (ifint($rows['edu']))?'<span>'.udata('edu',intval($rows['edu'])).'</span>':'';
			$pay   = (ifint($rows['pay']))?'<span>'.udata('pay',intval($rows['pay'])).'</span>':'';
			$job   = (ifint($rows['job']))?'<span>'.udata('job',intval($rows['job'])).'</span>':'';
			$love      = (ifint($rows['love']))?'<span>'.udata('love',intval($rows['love'])).'</span>':'';
			$child     = (ifint($rows['child']))?'<span>'.udata('child',intval($rows['child'])).'</span>':'';
			//$area2title = (empty($area2title))?'':'<span>户籍：'.$area2title.'</span>';
			//$marrytype = (!empty($rows['marrytype']))?'<span>'.udata('marrytype',$rows['marrytype']).'</span>':'';
			//$house     = (ifint($rows['house']))?'<span>'.udata('house',intval($rows['house'])).'</span>':'';
			//$car       = (ifint($rows['car']))?'<span>'.udata('car',intval($rows['car'])).'</span>':'';
			//$companykind= (ifint($rows['companykind']))?'<span>'.udata('companykind',intval($rows['companykind'])).'</span>':'';
			//$marrytime = (ifint($rows['marrytime']))?'<span>'.udata('marrytime',intval($rows['marrytime'])).'结婚'.'</span>':'';
			//$smoking = (ifint($rows['smoking']))?'<span>'.udata('smoking',intval($rows['smoking'])).'</span>':'';
			//$drink   = (ifint($rows['drink']))?'<span>'.udata('drink',intval($rows['drink'])).'</span>':'';
			//
			$weixin = (!empty($weixin))?'<span onclick="copylxff(\''.$weixin.'\',\'《微信》\');"><font>微信：</font>'.$weixin.'</span>':'';
			$qq     = (!empty($qq))?'<span onclick="copylxff(\''.$qq.'\',\'《QQ》\');"><font>QQ：</font>'.$qq.'</span>':'';
			$mob    = (!empty($mob))?'<span><font>手机：</font><a href="tel:'.$mob.'">'.$mob.'</a></span>':'';
			$mob2   = (!empty($mob2))?'<span><font>备用手机：</font><a href="tel:'.$mob2.'">'.$mob2.'</a></span>':'';
			$weixin_pic  = (!empty($weixin_pic))?'<span><img src="'.UP.$weixin_pic.'" onclick="ZeaiM.piczoom(\''.UP.$weixin_pic.'\');">微信二维码</span>':'';
			$contact_str = $weixin.$weixin_pic.$qq.$mob.$mob2;
			//
			if($flag == -2){
				$flag_str = '<img src="images/flag_2.png" width="60" height="60" class="flag_ico">';
			}else{
				$flag_str = '';
			}
			if($crm_ugrade>0){
				$crm_flag_str = ($crm_flag==3)?'<img src="images/crm_flag3.png" class="crm_flag3_ico">':'<div class="crm_flag3_ico">'.crm_flag_title($crm_flag).'</div>';
			}else{$crm_flag_str='';}
			if($myinfobfb >80){$myinfobfb_cls = ' myinfobfb2 ';}elseif($myinfobfb >20){$myinfobfb_cls = ' myinfobfb1';}else{$myinfobfb_cls = ' myinfobfb0';}
			$myinfobfb_str = '<span class="myinfobfb'.$myinfobfb_cls.'">'.$myinfobfb.'%</span>';
			$crm_vip_title = crm_ugrade_time($uidd,$crm_ugrade,'noAno__',$crm_usjtime1,$crm_usjtime2);
			$ddiff = $crm_usjtime2-ADDTIME;
			if ($ddiff < 0){
				$tip_top = '<span class="Cf00">已过期</span>';
			} else {
				$tip_top = '还剩<span class="Cf00">'.intval($ddiff/86400).'</span>天';
			}
            $agenttitle = dataIO($rows['agenttitle'],'out');
            $agenttitle = (!empty($agenttitle))?'<font class="C999">门店：</font>'.$agenttitle.'<br>':'';
			$crm_ubz = (!empty($crm_ubz))?'<span>备注：'.$crm_ubz.'</span>':'';
			$jczl_str = $age.$love.$child.$heigh.$edu.$pay.$job.$areatitle.$crm_ubz;//.$birthday.$area2title.$weigh
			///$shhy_str = $child.$marrytype.$marrytime.$smoking.$drink;
			//$jjzk_str = $companykind.$house.$car;
			$mate_str = mate_echo($rows);
			?>
            <dl id="tr<?php echo $id;?>">
            	<div class="tbody">
                	<input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $uidd; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
                	<?php echo uicon($sex.$grade);?><b><?php echo $uidd;?></b><font>（<?php echo $truename.$nickname;?>）</font>
                    <div class="vip_title">
                    	<?php if (!empty($crm_vip_title)){?>
							<?php echo $crm_vip_title;?><div class="tip_top"><?php echo $tip_top;?></div>
                        <?php }?>
                    </div>
				</div>
                <dt>
                	<a href="<?php echo mHref('crm_u',$uidd);?>"><img class="photo_s" src="<?php echo $photo_s_url;?>"></a>
                	<span class="myinfobfb<?php echo $myinfobfb_cls;?>"><?php echo $myinfobfb;?>%</span>
                    <span class="user_kind"><font class="kind<?php echo $kind;?>"><?php echo user_kind($rows['kind']); ?></font></span>
                </dt>
                <dd>
                    <?php echo $jczl_str;?>
                </dd>
                <?php echo $flag_str.$crm_flag_str;?>
                <div class="clear"></div>
				<div class="datali u2data">
					<?php if (!empty($agenttitle) || !empty($admname) || !empty($admid) || !empty($hnname) || !empty($hnid) || !empty($hnname2) || !empty($hnid2)){?>
                    <div class="dt"><i class="ico">&#xe613;</i>归属信息<span class="ico">&#xe60b; 展开</span></div>         
                    <div class="dd onoff">
                        <?php echo $agenttitle;
                        $adm_str = ($admtime>0)?'认领':'录入';
                        if(!empty($admname) || !empty($admid)){echo '<font class="C999">'.$adm_str.'：</font>'.$admname.' <font class="C999">ID:'.$admid.'</font>';}
                        if(!empty($hnname) || !empty($hnid)){echo '<br><font class="C999">售前：</font>'.$hnname.' <font class="C999">ID:'.$hnid.'</font>';if($crm_ugrade==0)echo sea_djs($seatime,'sq');}
                        if(!empty($hnname2) || !empty($hnid2)){echo '<br><font class="C999">售后：</font>'.$hnname2.' <font class="C999">ID:'.$hnid2.'</font>';if($crm_ugrade>0)echo sea_djs($seatime,'sh');}?>
                    </div>
                    <div class="clear"></div><div class="dd" style="height:5px;padding:0"></div>
					<?php }?>
                	<?php if (!empty($mate_str)){?>
                        <div class="dt"><i class="ico">&#xe65a;</i>择偶要求<span class="ico">&#xe60b; 展开</span></div><div class="dd onoff zoyq"><?php echo $mate_str;?></div>
                        <div class="clear"></div><div class="dd" style="height:5px;padding:0"></div>     
					<?php }?>
                    <?php if (!empty($contact_str) && crm_ifcontact($agentid,$admid,$hnid,$hnid2)){?>
						<div class="dt"><i class="ico">&#xe627;</i>联系方法<span class="ico">&#xe60b; 展开</span></div><div class="dd onoff"><?php echo $contact_str;?></div>
					<?php }?>
                    
                </div>
                <div class="ubtnbox">
					<?php
                    $rowf = $db->ROW(__TBL_QIANXIAN__,"id","senduid=".$uid." AND uid=".$uidd,"num");
                    if ($rowf){
                        $qxstr = '<i class="ico">&#xe67f;</i> 已牵线';
                        $qxscls= ' zeaiborder2';
                    }else{
                        $qxstr = '<i class="ico">&#xe622;</i> 牵线';
                        $qxscls= ' zeaibg';
                    }
                    ?>
                    <a href="javascript:utext(<?php echo $uidd;?>)" class="btn size2 BAI FL">文本卡</a>
                    <a href="<?php echo HOST;?>/m/my_card.php?uid=<?php echo $uidd;?>" class="btn size2 BAI FL">相亲卡</a>
                    <a class="btn size2 FR qianxian<?php echo $qxscls;?>" senduid="<?php echo $uid;?>" uid="<?php echo $uidd;?>"><?php echo $qxstr;?></a>
                    <div class="clear"></div>
                </div>
            </dl>
			<?php
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>
<?php if ($total > 0 ){?>
    <?php echo $page_cls;?>
    <div class="listbottombox">
        <div class="qxnum">需成功<b><?php echo $Uqxneednum;?></b>次，当前<b><?php echo $Uqxnum2;?></b>次</div>
        <?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
    </div>
    <div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
    <script>
    document.body.onscroll = backtop_alone;
	zeai.listEach('.onoff',function(obj){
		var objH = obj.offsetHeight;
			var c = obj.previousElementSibling;
			var span = zeai.tag(c,'span')[0];
			span.onclick = function(){obj.show();span.hide();}
	});
	function copylxff(str,t){zeai.copy(str,function(){zeai.msg(t+'复制成功<br>您可以粘贴分享给好友啦');});}
	function utext(uid){
		zeai.ajax('m_crm_user'+zeai.ajxext+'submitok=utext&uid='+uid,function(e){var rs=zeai.jsoneval(e);
			if (rs.flag == 1){
				zeai.copy(rs.C,function(){zeai.msg('《个人资料》复制成功<br>您可以粘贴分享给好友啦');})
			}else{
				zeai.msg(rs.msg);	
			}
		});
	}
	zeai.listEach('.qianxian',function(obj){
		obj.onclick = function(){
			var senduid = parseInt(obj.getAttribute("senduid")),
			uid = parseInt(obj.getAttribute("uid")),
			button_str = obj.innerHTML,str;
            button_str = button_str.replace(/[^\u4e00-\u9fa5\uf900-\ufa2d]/g,'');
			str = (button_str=='已牵线')?'和该用户已经牵线，确定再次牵线么？':'确定要牵线么？';
			if(button_str=='已牵线'){
				zeai.confirm(str,function(){
					zeai.alertplus({title:'请选择牵线发起方',content:'',title1:'客户要求',title2:'红娘主动',
						fn1:function(){qianxianFn(uid,senduid,1);},
						fn2:function(){qianxianFn(uid,senduid,2);}
					});
				});
			}else{
				zeai.alertplus({title:'请选择牵线发起方',content:'',title1:'客户要求',title2:'红娘主动',
					fn1:function(){qianxianFn(uid,senduid,1);},
					fn2:function(){qianxianFn(uid,senduid,2);}
				});
			}
		}
	});
	function qianxianFn(uid,senduid,sendkind){
		zeai.alertplus(0);
		zeai.ajax({url:'crm_select'+zeai.extname,data:{submitok:'ajax_qianxian_add',uid:uid,senduid:senduid,sendkind:sendkind}},function(e){rs=zeai.jsoneval(e);
			zeai.msg(0);zeai.msg(rs.msg);
			if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
		});
	}
    </script>
    <script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
</body></html><?php ob_end_flush();?>